package com.example.car.api

import com.example.car.entity.CarAddEntity
import com.example.car.entity.CarAddParam
import com.example.car.entity.CarPayEntity
import com.example.car.entity.CarPayParam
import com.example.car.entity.CarStopEntityItem
import com.example.car.entity.ParkingEntity
import com.example.car.model.CarResultData
import com.example.common.view.api.BaseApiService
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path

interface CarApiService :BaseApiService{
    //增加车辆信息
    @POST("/api/vehicles")
    suspend fun getAddCar(@Body carAddParam: CarAddParam):CarResultData<CarAddEntity>
    //增加消费记录
    @POST("/api/parking-payments")
    suspend fun getAddCarPay(@Body carPayParam: CarPayParam):CarResultData<CarPayEntity>
    //获取停车记录
    @GET("/api/parking-payments")
    suspend fun getCarStop():CarResultData<List<CarStopEntityItem>>
    //获取车位列表
    @GET("/api/parking-spaces/area/{areaId}")
    suspend fun getParking(@Path("areaId")areaId:Int):CarResultData<List<ParkingEntity>>
    //添加车位
    @POST("/api/parking-spaces")
    suspend fun addParking(@Body parking:ParkingEntity) : CarResultData<ParkingEntity>
    //修改车位
    @PUT("/api/parking-spaces/{id}")
    suspend fun updateParking(@Path("id") id : Int,@Body parking:ParkingEntity ) : CarResultData<ParkingEntity>
    //车辆列表
    @GET("/api/parking-payments")
    suspend fun getCarList() : CarResultData<List<CarPayEntity>>
}